package org.example.springboot.controller;

import org.apache.ibatis.annotations.Result;
import org.example.springboot.model.Users;
import org.example.springboot.service.UsersService;
import org.example.springboot.utils.JwtUtil;
import org.hibernate.annotations.processing.Pattern;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.HashMap;
import java.util.Map;

@RestController
public class LoginController {
    private Users users;
    @Autowired
    private UsersService usersService;
    @PostMapping("/login/{username}/{password}")
    public String login(@PathVariable String username, @PathVariable String password){
        Map<String,Object> claims = new HashMap<>();
        claims.put("username",username);
        claims.put("password",password);
        String token = JwtUtil.genToken(claims);

        return token;


    }
}
